// 统计分析相关 API
import request from '@/utils/request';

import { ApiResponse } from '@/types/common';
import { StatisticsData } from '@/types/system';

export const statisticsApi = {
  // 获取总体统计数据
  getOverallStats: (): Promise<ApiResponse<StatisticsData>> =>
    request.get('/statistics/overall'),

  // 获取仪器使用统计
  getInstrumentUsageStats: (params?: { startDate?: string; endDate?: string }): Promise<ApiResponse<Record<string, unknown>[]>> =>
    request.get('/statistics/instrument-usage', params),

  // 获取订单统计
  getOrderStats: (params?: { startDate?: string; endDate?: string }): Promise<ApiResponse<Record<string, unknown>[]>> =>
    request.get('/statistics/orders', params),

  // 获取收入统计
  getRevenueStats: (params?: { startDate?: string; endDate?: string }): Promise<ApiResponse<Record<string, unknown>[]>> =>
    request.get('/statistics/revenue', params),

  // 获取用户活跃度统计
  getUserActivityStats: (params?: { startDate?: string; endDate?: string }): Promise<ApiResponse<Record<string, unknown>[]>> =>
    request.get('/statistics/user-activity', params),
}; 